<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="time"></div>
		
		<script>
			const time = document.getElementById('time');
			
			const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
			
			// 更新时间的函数
			function updateTime() {
			    // 获取当前时间
			    const now = new Date();
			    
			    // 获取年、月、日
			    const year = now.getFullYear();
			    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始，所以加1
			    const day = String(now.getDate()).padStart(2, '0');
			    
			    // 获取星期几
			    const weekday = weekdays[now.getDay()];
			    
			    // 获取时、分、秒，并补零
			    const hours = String(now.getHours()).padStart(2, '0');
			    const minutes = String(now.getMinutes()).padStart(2, '0');
			    const seconds = String(now.getSeconds()).padStart(2, '0');
				
				time.textContent = `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds} ${weekday}`;
				}
			    
				
				// 立即更新一次时间
				updateTime();
				
				// 每秒更新一次时间
				setInterval(updateTime, 1000);
		</script>
	</body>
</html>